package com.atgui.jedis;

import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;

import java.util.HashSet;
import java.util.Set;

public class RedisClusterDemo {
    public static void main(String[] args) {
        Set<HostAndPort> set =new HashSet<HostAndPort>();
        set.add(new HostAndPort("192.168.195.170",6379));
        JedisCluster jedisCluster=new JedisCluster(set);
        jedisCluster.set("k3", "v1");
        System.out.println(jedisCluster.get("k3"));

    }
}
//        HostAndPort hostAndPort = new HostAndPort("192.169.195.170", 6379);
//        JedisCluster jedisCluster =new JedisCluster(hostAndPort);
//        //进行操作
//        jedisCluster.set("k1","k11");
//        System.out.println(jedisCluster.get("k1"));
//        jedisCluster.close();